package com.springboot.demo.entity.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * @author wubc683
 * @desc
 * @date 2021-08-12 17:49
 */
@Data
@ApiModel(description = "变量数不超过500")
public class VariableVO {
    @ApiModelProperty(value = "变量id", required = true)
    @NotNull(message = "变量id不能为空")
    private Long id;
    @ApiModelProperty(value = "变量序号id", required = true)
    @NotNull(message = "变量序号id不能为空")
    private Integer varId;
    @ApiModelProperty(value = "变量名称", required = true)
    @NotNull(message = "变量名称不能为空")
    private String name;
    @ApiModelProperty(value = "连接id", required = true)
    @NotNull(message = "连接id不能为空")
    private Integer connectId;
    //    @ApiModelProperty(value = "连接名称", required = true)
//    @NotBlank(message = "连接名称不能为空")
//    @Length(max=32,message = "连接名称太长")
//    private String connectName;
    @ApiModelProperty(value = "场景id", required = true)
    @NotNull(message = "场景id不能为空")
    private Integer sceneId;
    @ApiModelProperty(value = "数据类型", required = true)
    @NotNull(message = "数据类型不能为空")
    private Integer dataType;
    @ApiModelProperty(value = "长度", required = true)
    @NotNull(message = "变量长度不能为空")
    private Integer len;           //变量的数据长度，字节个数, 位变量为位的个数
    @ApiModelProperty(value = "采集周期，单位毫秒 (最大周期值24小时)", required = true)
    @NotNull(message = "采集周期不能为空")
    private Integer cycleTime;
    @ApiModelProperty(value = "变量所在的区域", required = true)
    @NotNull(message = "变量区域不能为空")
    private Integer area;
    @ApiModelProperty(value = "变量所在的子区域", required = true)
    @NotNull(message = "变量子区域不能为空")
    private Integer subArea;
    @ApiModelProperty(value = "数据在PLC中的地址偏移量", required = true)
    @NotNull(message = "地址偏移量不能为空")
    private Integer addOffset;
    @ApiModelProperty(value = "如果需要位偏移量，那么这个位变量的偏移量，否则写-1", required = true)
    @NotNull(message = "位偏移量不能为空")
    private Integer bitOffset;
}
